<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <style>
.acc{
    background-color: #096;
    height: 20px;
    width: 100px;
}
    .box{
        background-color: #f0f;
        box-sizing: border-box;

        width: 100px;
        /* margin-top: 30px; */

    }
    .item{
        position: relative;
        height: 50px;
        background-color: #f90;
        

    }
    .item::after{
        content: "取消行程";
        position: absolute;
        top: -15px;
        height: calc(100% + 30px);
        background-color: #09f;
        display: flex;
        align-items: center;
        z-index: 9;
    }
  </style>
  <body>
    <div class="acc"></div>
    <div class="box">
        <div class="item">

        </div>
    </div>
    <div class="acc"></div>

    <script>
      var arr = [];
      for (var i = 0; i < 10; i++) {
        arr[i] = function () {
          console.log(i);
        };
      }

      for (var j = 0; j < arr.length; j++) {
        arr[j]();
      }
    </script>
  </body>
</html>
